package org.aeon.gamechatnest.validated.annotation;


import jakarta.validation.Constraint;
import jakarta.validation.Payload;
import org.aeon.gamechatnest.validated.validator.AnyNotEmptyValidator;

import java.lang.annotation.*;

/**
 * @author MissingAeon
 * @date 2024/5/10 13:24
 * @description
 */
@Target({ElementType.PARAMETER, ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = AnyNotEmptyValidator.class)
@Documented
public @interface AnyNotEmpty {

    /**
     * 异常提示信息
     */
    String message() default "请至少填写一个";

    /**
     * 校验值
     * 相同的值为一组
     */
    int value() default 0;

    /**
     * 校验属性对应的类
     *
     * @return
     */
    Class<?> clazz();

    /**
     * 默认配置 - 不加要报错
     */
    Class<?>[] groups() default {};

    /**
     * 默认配置 - 不加要报错
     */
    Class<? extends Payload>[] payload() default {};
}
